Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several improvements: Support move semantic + remove vector in favour of std one + add support for std::string with -D DASH_USE_STL_STRING=1 #245

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

mathieucarbou
Copy link
Contributor

@mathieucarbou mathieucarbou commented Nov 14, 2024

Several improvements in this PR:

1) using std::vector instead of current vector class

2)Support for move semantic for strings to avoid a buffer copy for rvalues

Move semantic allows to avoid a second buffer copy when calling ESP-DASH with rvalues like that:

card.update(String("Hello") + " World!");
card.update(WiFI.localIP().toString());

The created buffer will directly be transferred to the internal class, which reduces heap fragmentation.

These update() calls being frequently called so this is a relevant optimizaiton.

3) add support for std::string with -D DASH_USE_STL_STRING=1

Copy link
Contributor

github-actions bot commented Nov 14, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@mathieucarbou
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Nov 14, 2024
@mathieucarbou mathieucarbou force-pushed the dev branch 3 times, most recently from db80f53 to 03fd807 Compare November 14, 2024 20:39
@mathieucarbou mathieucarbou marked this pull request as draft November 14, 2024 20:44
@mathieucarbou mathieucarbou changed the title Support move semantic and removed vector implementation in favour of std one Several improvements: Support move semantic + remove vector in favour of std one + add support for STL string Nov 14, 2024
@mathieucarbou mathieucarbou marked this pull request as ready for review November 14, 2024 20:48
@mathieucarbou mathieucarbou changed the title Several improvements: Support move semantic + remove vector in favour of std one + add support for STL string Several improvements: Support move semantic + remove vector in favour of std one Nov 22, 2024
@mathieucarbou mathieucarbou changed the title Several improvements: Support move semantic + remove vector in favour of std one Several improvements: Support move semantic + remove vector in favour of std one + add support for std::string with -D DASH_USE_STL_STRING=1 Nov 22, 2024
@mathieucarbou
Copy link
Contributor Author

@ayushsharma82 : FYI.

I also have the same commits for the pro version in my dev branch.

I refreshed them just now (minor cleanups) and rebased.

@ayushsharma82
Copy link
Owner

Thanks @mathieucarbou , I'll merge everything in upcoming days.

@mathieucarbou mathieucarbou mentioned this pull request Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants